package com.cl.it.custom.controller;

import com.access.helper.spider.*;
import com.cl.it.spider.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

@RestController
@RequestMapping("/bfbff290a25d43e09d23214260fa4c3c")
public class SpiderController {

    @Autowired
    private QccSpider qccSpider;

    @Autowired
    private ItJuziSpider itJuziSpider;

    @Autowired
    private WebSiteSpider webSiteSpider;

    @Autowired
    private IfengSpider ifengSpider;

    @Autowired
    private JiemianSpider jiemianSpider;

    @Autowired
    private CyzoneSpider cyzoneSpider;

    @Autowired
    private ToutiaoSpider toutiaoSpider;

    @GetMapping("/all")
    public String all() {
        qccSpider.execute();
        itJuziSpider.execute();
        webSiteSpider.execute();
        toutiaoSpider.execute();
        ifengSpider.execute();
        jiemianSpider.execute();
        cyzoneSpider.execute();
        return "ok";
    }

    @GetMapping("/callQccSpider")
    public String callQccSpider() {
        qccSpider.execute();
        return "ok";
    }

    @GetMapping("/callItJuziSpider")
    public String callItJuziSpider() {
        itJuziSpider.execute();
        return "ok";
    }

    @GetMapping("/callWebSiteSpider")
    public String callWebSiteSpider() {
        webSiteSpider.execute();
        return "ok";
    }

    @GetMapping("/callToutiaoSpider")
    public String callToutiaoSpider() {
        toutiaoSpider.execute();
        return "ok";
    }

    @GetMapping("/callIfengSpider")
    public String callIfengSpider() {
        ifengSpider.execute();
        return "ok";
    }

    @GetMapping("/callJiemianSpider")
    public String callJiemianSpider() {
        jiemianSpider.execute();
        return "ok";
    }

    @GetMapping("/callCyzoneSpider")
    public String callCyzoneSpider() {
        cyzoneSpider.execute();
        return "ok";
    }

    public static void main(String[] args) {
        System.out.println(UUID.randomUUID().toString().replaceAll("\\-", ""));
    }
}
